package com.zb.vo;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.zb.entity.AccounLoginInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Author WEN
 * @Date 2024/1/12 0012
 **/
@Data
@ApiModel(value = "出入库日志对象")
public class StoreBoundVo {
    private Long id;

    @ApiModelProperty(value = "商家ID")
    private Long custAccId;

    @ApiModelProperty(value = "入库表ID/出库表ID")
    private Long storeBoundId;

    @ApiModelProperty(value = "入库/出库单号")
    private String storeBoundNo;

    @ApiModelProperty(value = "操作人ID")
    private Long createEmpId;

    @ApiModelProperty(value = "操作人名称")
    private String createEmp;

    @ApiModelProperty(value = "事件标题")
    private String event;

    @ApiModelProperty(value = "内容")
    private String content;

    private StoreBoundVo(){}


    public StoreBoundVo(AccounLoginInfo loginInfo, Long storeBoundId, String storeBoundNo, String event, String content) {
        this.id = IdWorker.getId();
        this.custAccId = loginInfo.getCustAccId();
        this.storeBoundId = storeBoundId;
        this.storeBoundNo = storeBoundNo;
        this.createEmpId = loginInfo.getId();
        this.createEmp = loginInfo.getName();
        this.event = event;
        this.content = StringUtils.isNotBlank(content)? content : "";
    }
}
